﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AnyGrid
{
    /// <summary>
    /// Indicates whether any individual user can ever add, edit, delete, or view details of 
    /// a record of a certain type, and, if so, which action to use for it.
    /// Grids can read this to configure their UI to show or hide buttons for these actions.
    /// </summary>
    public class LinkedActions
    {
        /// <summary>
        /// Action name for deleting a record of this type.  Leave null if delete not allowed.
        /// </summary>
        public string DeleteActionName { get; set; }
        
        /// <summary>
        /// Action name for viewing details of a record of this type.  Leave null if there is no details page.
        /// </summary>
        public string DetailsActionName { get; set; }
        
        /// <summary>
        /// Action name for inserting a record of this type.  Leave null if insert not allowed.
        /// </summary>
        public string InsertActionName { get; set; }
        
        /// <summary>
        /// Action name for updating a record of this type.  Leave null if update not allowed.
        /// </summary>
        public string UpdateActionName { get; set; }
        
        /// <summary>
        /// Actions for performing custom operations.  
        /// </summary>
        public IList<string> CustomActions 
        {
            get { return this._customActions; } 
        }

        private List<string> _customActions = new List<string>();
    }
}
